Skip to content

refactor: Don't remove raw borrows in remove_unnecessary_refs#1811

Merged
ahomescu merged 1 commit into
immunant:masterfrom
Rua:refactor-dont-remove-raw-borrows
Jun 11, 2026
Merged

refactor: Don't remove raw borrows in remove_unnecessary_refs#1811
ahomescu merged 1 commit into
immunant:masterfrom
Rua:refactor-dont-remove-raw-borrows

Conversation

@Rua

@Rua Rua commented May 16, 2026

Copy link
Copy Markdown
Contributor

Small bugfix for a problem that showed itself in CI with #1810.

@Rua Rua force-pushed the refactor-dont-remove-raw-borrows branch from d5522de to 95ce56a Compare May 30, 2026 21:05
fn remove_ref(expr: &mut P<Expr>) {
match &expr.kind {
ExprKind::AddrOf(_, _, inner) => *expr = inner.clone(),
ExprKind::AddrOf(BorrowKind::Ref, _, inner) => *expr = inner.clone(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also covers &pin borrows, but I guess that's fine? The transpiler wouldn't emit those anyway.

@ahomescu ahomescu merged commit 703aa4c into immunant:master Jun 11, 2026
11 checks passed
@Rua Rua deleted the refactor-dont-remove-raw-borrows branch June 11, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants